/*
 * Group 3, User Interface Programming II (vt11)
 * Pooya | Flora | Monica | Can
 */
package vical.action;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import vical.model.Internationalization;
import vical.view.AddEntryDialog;
import vical.view.EntryDialog;
import vical.view.MainWindow;

/**
 * Add entry action, issues a command to show an GUI element to allow the user
 * to enter a new entry's information.
 *
 * @author WoKe
 * @author Can
 */
public class EntryDialogAction extends AbstractAction {

    private MainWindow mainWindow;

    public EntryDialogAction(MainWindow mainWindow) {
        super(Internationalization.getString("add"));
        putValue(MNEMONIC_KEY, Internationalization.getMnemonic("mnemonics_add_task_button"));
        this.mainWindow = mainWindow;
    }

    public void actionPerformed(ActionEvent e) {
        EntryDialog entryDialog = new AddEntryDialog();
        entryDialog.setVisible(true);
        mainWindow.getViewPanel().refresh();
        mainWindow.updateLeftPanel();
    }
}
